<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta name="Content-Type" content="text/html; charset=UTF-8" />
<title>Class: Sass::Plugin::Compiler</title>
<link rel="stylesheet" href="style.css" tppabs="http://sass-lang.com/docs/yardoc/css/style.css" type="text/css" media="screen" charset="utf-8" />
<link rel="stylesheet" href="common.css" tppabs="http://sass-lang.com/docs/yardoc/css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  relpath = '../..';
  if (relpath != '') relpath += '/';
</script>
<script type="text/javascript" charset="utf-8" src="jquery.js" tppabs="http://sass-lang.com/docs/yardoc/js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="app.js" tppabs="http://sass-lang.com/docs/yardoc/js/app.js"></script>

  </head>
  <body>
    <script type="text/javascript" charset="utf-8">
      if (window.top.frames.main) document.body.className = 'frames';
    </script>
    
    <div id="header">
      <div id="menu">
  
    <a href="_index.html" tppabs="http://sass-lang.com/docs/yardoc/_index.html">Index (C)</a> &raquo; 
    <span class='title'><a href="Sass-1.html" tppabs="http://sass-lang.com/docs/yardoc/Sass.html" title="Sass (module)">Sass</a></span> &raquo; <span class='title'><a href="Plugin.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin.html" title="Sass::Plugin (module)">Plugin</a></span>
     &raquo; 
    <span class="title">Compiler</span>
  
  
  <div class="noframes"><span class="title">(</span><a href="javascript:if(confirm(%27http://sass-lang.com/docs/yardoc/Sass/Plugin/.  \n\nThis file was not retrieved by Teleport Pro, because the server reports that this file cannot be found.  \n\nDo you want to open it from the server?%27))window.location=%27http://sass-lang.com/docs/yardoc/Sass/Plugin/.%27" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin/." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  <a id="class_list_link" href="#">Class List</a>
  <a id="method_list_link" href="#">Method List</a>
  <a id ="file_list_link" href="#">File List</a>
</div>

      <div class="clear"></div>
    </div>
    
    <iframe id="search_frame"></iframe>
    
    <div id="content"><h1>Class: Sass::Plugin::Compiler 
  
  
</h1>

<dl class="box">
  
    <dt class="r1">Inherits:</dt>
    <dd class="r1">
      <span class="inheritName">Object</span>
      
        <ul class="fullTree">
          <li>Object</li>
          
            <li class="next">Sass::Plugin::Compiler</li>
          
        </ul>
        <a href="#" class="inheritanceTree">show all</a>
      
      </dd>
    
  
  
    
      <dt class="r2">Extends:</dt>
      <dd class="r2"><a href="Callbacks.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Callbacks.html" title="Sass::Callbacks (module)">Sass::Callbacks</a></dd>
      
    
  
    
      <dt class="r1">Includes:</dt>
      <dd class="r1"><a href="Configuration.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin/Configuration.html" title="Sass::Plugin::Configuration (module)">Configuration</a>, <a href="Util.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html" title="Sass::Util (module)">Sass::Util</a></dd>
      
    
  
  
    <dt class="r2 last">Defined in:</dt>
    <dd class="r2 last">/var/www/sass-pages/.sass/lib/sass/plugin/compiler.rb</dd>
  
</dl>
<div class="clear"></div>

<h2>Overview</h2><div class="docstring">
  <div class="discussion">
    <p>The Compiler class handles compilation of multiple files and/or directories, including checking which CSS files are out-of-date and need to be updated and calling Sass to perform the compilation on those files.</p>

<p><tt><a href="Plugin.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin.html" title="Sass::Plugin (module)">Sass::Plugin</a></tt> uses this class to update stylesheets for a single application. Unlike <tt><a href="Plugin.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin.html" title="Sass::Plugin (module)">Sass::Plugin</a></tt>, though, the Compiler class has no global state, and so multiple instances may be created and used independently.</p>

<p>If you need to compile a Sass string into CSS, please see the <tt><a href="Engine.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Engine.html" title="Sass::Engine (class)">Sass::Engine</a></tt> class.</p>

<p>Unlike <tt><a href="Plugin.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin.html" title="Sass::Plugin (module)">Sass::Plugin</a></tt>, this class doesn&#8217;t keep track of whether or how many times a stylesheet should be updated. Therefore, the following <code>Sass::Plugin</code> options are ignored by the Compiler:</p>

<ul>
<li><code>:never_update</code></li>

<li><code>:always_check</code></li>
</ul>

  </div>
</div>
<div class="tags">
  
</div>
  <h2>Constant Summary</h2>
  


  
  
  
  
  <h3 class="inherited">Constants included from <a href="Util.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html" title="Sass::Util (module)">Sass::Util</a></h3>
  <p class="inherited"><a href="Util.html#RUBY_ENGINE-constant" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#RUBY_ENGINE-constant" title="Sass::Util::RUBY_ENGINE (constant)">RUBY_ENGINE</a>, <a href="Util.html#RUBY_VERSION-constant" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#RUBY_VERSION-constant" title="Sass::Util::RUBY_VERSION (constant)">RUBY_VERSION</a></p>

  
  
  
  

  <h2>Instance Method Summary</h2>

  <ul class="summary">
    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#engine_options-instance_method" title="#engine_options (instance method)">- ({Symbol =&gt; Object}) <strong>engine_options</strong>(additional_options = {}) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Non-destructively modifies <tt><a href="Configuration.html#options-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin/Configuration.html#options-instance_method" title="Sass::Plugin::Configuration#options (method)">#options</a></tt> so that default values are properly set, and returns the result.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#initialize-instance_method" title="#initialize (instance method)">- (Compiler) <strong>initialize</strong>(options = {}) </a>
    

    
  </span>
  
    <span class="note title constructor">constructor</span>
  
  
  
  
  

  
    <span class="summary_desc">Creates a new compiler.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#on_compilation_error-instance_method" title="#on_compilation_error (instance method)">- <strong>on_compilation_error</strong> {|error, template, css| ... }</a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Register a callback to be run when there&#8217;s an error compiling a Sass file.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#on_creating_directory-instance_method" title="#on_creating_directory (instance method)">- <strong>on_creating_directory</strong> {|dirname| ... }</a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Register a callback to be run when Sass creates a directory into which to put CSS files.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#on_deleting_css-instance_method" title="#on_deleting_css (instance method)">- <strong>on_deleting_css</strong> {|filename| ... }</a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Register a callback to be run when Sass deletes a CSS file.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#on_not_updating_stylesheet-instance_method" title="#on_not_updating_stylesheet (instance method)">- <strong>on_not_updating_stylesheet</strong> {|template, css| ... }</a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Register a callback to be run when Sass decides not to update a stylesheet.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#on_template_created-instance_method" title="#on_template_created (instance method)">- <strong>on_template_created</strong> {|template| ... }</a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Register a callback to be run when Sass detects that a new template has been created.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#on_template_deleted-instance_method" title="#on_template_deleted (instance method)">- <strong>on_template_deleted</strong> {|template| ... }</a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Register a callback to be run when Sass detects that a template has been deleted.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#on_template_modified-instance_method" title="#on_template_modified (instance method)">- <strong>on_template_modified</strong> {|template| ... }</a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Register a callback to be run when Sass detects that a template has been modified.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#on_updated_stylesheet-instance_method" title="#on_updated_stylesheet (instance method)">- <strong>on_updated_stylesheet</strong> {|template, css| ... }</a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Register a callback to be run after a single stylesheet is updated.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#on_updating_stylesheet_with_deprecation_warning-instance_method" title="#on_updating_stylesheet_with_deprecation_warning (instance method)">- <strong>on_updating_stylesheet_with_deprecation_warning</strong>(&amp;block) </a>
    

    
      (also: #on_updating_stylesheet)
    
  </span>
  
  
  
  
  

  
    <span class="summary_desc"></span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#on_updating_stylesheets-instance_method" title="#on_updating_stylesheets (instance method)">- <strong>on_updating_stylesheets</strong> {|individual_files| ... }</a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Register a callback to be run after stylesheets are mass-updated.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#stylesheet_needs_update%3F-instance_method" title="#stylesheet_needs_update? (instance method)">- (Boolean) <strong>stylesheet_needs_update?</strong>(css_file, template_file) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Compass expects this to exist.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#update_stylesheets-instance_method" title="#update_stylesheets (instance method)">- <strong>update_stylesheets</strong>(individual_files = []) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Updates out-of-date stylesheets.</span>
  
</li>

    
      <li class="public ">
  <span class="summary_signature">
    
      <a href="#watch-instance_method" title="#watch (instance method)">- <strong>watch</strong>(individual_files = []) </a>
    

    
  </span>
  
  
  
  
  

  
    <span class="summary_desc">Watches the template directory (or directories) and updates the CSS files whenever the related Sass/SCSS files change.</span>
  
</li>

    
  </ul>

  
  
  
  
  
  <h3 class="inherited">Methods included from <a href="Util.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html" title="Sass::Util (module)">Sass::Util</a></h3>
  <p class="inherited"><a href="Util.html#abstract-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#abstract-instance_method" title="Sass::Util#abstract (method)">#abstract</a>, <a href="Util.html#ap_geq%3F-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#ap_geq%3F-instance_method" title="Sass::Util#ap_geq? (method)">#ap_geq?</a>, <a href="Util.html#ap_geq_3%3F-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#ap_geq_3%3F-instance_method" title="Sass::Util#ap_geq_3? (method)">#ap_geq_3?</a>, <a href="Util.html#array_minus-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#array_minus-instance_method" title="Sass::Util#array_minus (method)">#array_minus</a>, <a href="Util.html#av_template_class-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#av_template_class-instance_method" title="Sass::Util#av_template_class (method)">#av_template_class</a>, <a href="Util.html#caller_info-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#caller_info-instance_method" title="Sass::Util#caller_info (method)">#caller_info</a>, <a href="Util.html#check_encoding-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#check_encoding-instance_method" title="Sass::Util#check_encoding (method)">#check_encoding</a>, <a href="Util.html#check_range-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#check_range-instance_method" title="Sass::Util#check_range (method)">#check_range</a>, <a href="Util.html#check_sass_encoding-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#check_sass_encoding-instance_method" title="Sass::Util#check_sass_encoding (method)">#check_sass_encoding</a>, <a href="Util.html#destructure-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#destructure-instance_method" title="Sass::Util#destructure (method)">#destructure</a>, <a href="Util.html#enum_cons-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#enum_cons-instance_method" title="Sass::Util#enum_cons (method)">#enum_cons</a>, <a href="Util.html#enum_slice-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#enum_slice-instance_method" title="Sass::Util#enum_slice (method)">#enum_slice</a>, <a href="Util.html#enum_with_index-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#enum_with_index-instance_method" title="Sass::Util#enum_with_index (method)">#enum_with_index</a>, <a href="Util.html#extract%21-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#extract%21-instance_method" title="Sass::Util#extract! (method)">#extract!</a>, <a href="Util.html#extract_values-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#extract_values-instance_method" title="Sass::Util#extract_values (method)">#extract_values</a>, <a href="Util.html#flatten-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#flatten-instance_method" title="Sass::Util#flatten (method)">#flatten</a>, <a href="Util.html#glob-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#glob-instance_method" title="Sass::Util#glob (method)">#glob</a>, <a href="Util.html#group_by_to_a-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#group_by_to_a-instance_method" title="Sass::Util#group_by_to_a (method)">#group_by_to_a</a>, <a href="Util.html#has%3F-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#has%3F-instance_method" title="Sass::Util#has? (method)">#has?</a>, <a href="Util.html#hash_to_a-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#hash_to_a-instance_method" title="Sass::Util#hash_to_a (method)">#hash_to_a</a>, <a href="Util.html#inject_values-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#inject_values-instance_method" title="Sass::Util#inject_values (method)">#inject_values</a>, <a href="Util.html#inspect_obj-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#inspect_obj-instance_method" title="Sass::Util#inspect_obj (method)">#inspect_obj</a>, <a href="Util.html#intersperse-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#intersperse-instance_method" title="Sass::Util#intersperse (method)">#intersperse</a>, <a href="Util.html#ironruby%3F-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#ironruby%3F-instance_method" title="Sass::Util#ironruby? (method)">#ironruby?</a>, <a href="Util.html#jruby1_6%3F-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#jruby1_6%3F-instance_method" title="Sass::Util#jruby1_6? (method)">#jruby1_6?</a>, <a href="Util.html#jruby%3F-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#jruby%3F-instance_method" title="Sass::Util#jruby? (method)">#jruby?</a>, <a href="Util.html#jruby_version-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#jruby_version-instance_method" title="Sass::Util#jruby_version (method)">#jruby_version</a>, <a href="Util.html#lcs-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#lcs-instance_method" title="Sass::Util#lcs (method)">#lcs</a>, <a href="Util.html#macruby%3F-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#macruby%3F-instance_method" title="Sass::Util#macruby? (method)">#macruby?</a>, <a href="Util.html#map_hash-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#map_hash-instance_method" title="Sass::Util#map_hash (method)">#map_hash</a>, <a href="Util.html#map_keys-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#map_keys-instance_method" title="Sass::Util#map_keys (method)">#map_keys</a>, <a href="Util.html#map_vals-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#map_vals-instance_method" title="Sass::Util#map_vals (method)">#map_vals</a>, <a href="Util.html#merge_adjacent_strings-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#merge_adjacent_strings-instance_method" title="Sass::Util#merge_adjacent_strings (method)">#merge_adjacent_strings</a>, <a href="Util.html#ord-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#ord-instance_method" title="Sass::Util#ord (method)">#ord</a>, <a href="Util.html#paths-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#paths-instance_method" title="Sass::Util#paths (method)">#paths</a>, <a href="Util.html#powerset-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#powerset-instance_method" title="Sass::Util#powerset (method)">#powerset</a>, <a href="Util.html#rails_env-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#rails_env-instance_method" title="Sass::Util#rails_env (method)">#rails_env</a>, <a href="Util.html#rails_root-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#rails_root-instance_method" title="Sass::Util#rails_root (method)">#rails_root</a>, <a href="Util.html#rbx%3F-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#rbx%3F-instance_method" title="Sass::Util#rbx? (method)">#rbx?</a>, <a href="Util.html#restrict-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#restrict-instance_method" title="Sass::Util#restrict (method)">#restrict</a>, <a href="Util.html#ruby1%3F-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#ruby1%3F-instance_method" title="Sass::Util#ruby1? (method)">#ruby1?</a>, <a href="Util.html#ruby1_8%3F-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#ruby1_8%3F-instance_method" title="Sass::Util#ruby1_8? (method)">#ruby1_8?</a>, <a href="Util.html#ruby1_8_6%3F-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#ruby1_8_6%3F-instance_method" title="Sass::Util#ruby1_8_6? (method)">#ruby1_8_6?</a>, <a href="Util.html#sass_warn-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#sass_warn-instance_method" title="Sass::Util#sass_warn (method)">#sass_warn</a>, <a href="Util.html#scope-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#scope-instance_method" title="Sass::Util#scope (method)">#scope</a>, <a href="Util.html#set_eql%3F-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#set_eql%3F-instance_method" title="Sass::Util#set_eql? (method)">#set_eql?</a>, <a href="Util.html#set_hash-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#set_hash-instance_method" title="Sass::Util#set_hash (method)">#set_hash</a>, <a href="Util.html#silence_sass_warnings-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#silence_sass_warnings-instance_method" title="Sass::Util#silence_sass_warnings (method)">#silence_sass_warnings</a>, <a href="Util.html#silence_warnings-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#silence_warnings-instance_method" title="Sass::Util#silence_warnings (method)">#silence_warnings</a>, <a href="Util.html#strip_string_array-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#strip_string_array-instance_method" title="Sass::Util#strip_string_array (method)">#strip_string_array</a>, <a href="Util.html#subsequence%3F-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#subsequence%3F-instance_method" title="Sass::Util#subsequence? (method)">#subsequence?</a>, <a href="Util.html#substitute-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#substitute-instance_method" title="Sass::Util#substitute (method)">#substitute</a>, <a href="Util.html#to_hash-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#to_hash-instance_method" title="Sass::Util#to_hash (method)">#to_hash</a>, <a href="Util.html#undefined_conversion_error_char-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#undefined_conversion_error_char-instance_method" title="Sass::Util#undefined_conversion_error_char (method)">#undefined_conversion_error_char</a>, <a href="Util.html#version_geq-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#version_geq-instance_method" title="Sass::Util#version_geq (method)">#version_geq</a>, <a href="Util.html#version_gt-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#version_gt-instance_method" title="Sass::Util#version_gt (method)">#version_gt</a>, <a href="Util.html#windows%3F-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#windows%3F-instance_method" title="Sass::Util#windows? (method)">#windows?</a>, <a href="Util.html#with_extracted_values-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Util.html#with_extracted_values-instance_method" title="Sass::Util#with_extracted_values (method)">#with_extracted_values</a></p>

  
  
  
  
  
  <h3 class="inherited">Methods included from <a href="Configuration.html" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin/Configuration.html" title="Sass::Plugin::Configuration (module)">Configuration</a></h3>
  <p class="inherited"><a href="Configuration.html#add_template_location-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin/Configuration.html#add_template_location-instance_method" title="Sass::Plugin::Configuration#add_template_location (method)">#add_template_location</a>, <a href="Configuration.html#default_options-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin/Configuration.html#default_options-instance_method" title="Sass::Plugin::Configuration#default_options (method)">#default_options</a>, <a href="Configuration.html#options-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin/Configuration.html#options-instance_method" title="Sass::Plugin::Configuration#options (method)">#options</a>, <a href="Configuration.html#options%3D-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin/Configuration.html#options%3D-instance_method" title="Sass::Plugin::Configuration#options= (method)">#options=</a>, <a href="Configuration.html#remove_template_location-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin/Configuration.html#remove_template_location-instance_method" title="Sass::Plugin::Configuration#remove_template_location (method)">#remove_template_location</a>, <a href="Configuration.html#reset%21-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin/Configuration.html#reset%21-instance_method" title="Sass::Plugin::Configuration#reset! (method)">#reset!</a>, <a href="Configuration.html#template_location_array-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin/Configuration.html#template_location_array-instance_method" title="Sass::Plugin::Configuration#template_location_array (method)">#template_location_array</a></p>
<div id="constructor_details" class="method_details_list">
  <h2>Constructor Details</h2>
  
    <div class="method_details first">
  <p class="signature first" id="initialize-instance_method">
  
    - (<tt><a href="" title="Sass::Plugin::Compiler (class)">Compiler</a></tt>) <strong>initialize</strong>(options = {}) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Creates a new compiler.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>{Symbol =&gt; Object}</tt>)</span>
      
      
        <span class='name'>options</span>
      
      
        <em class="default">(defaults to: <tt>{}</tt>)</em>
      
      
        &mdash;
        See <a href="file.SASS_REFERENCE.html#sass_options" tppabs="http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#sass_options" title="the Sass options documentation">the Sass options documentation</a>.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


37
38
39</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/compiler.rb', line 37</span>

def initialize(options = {})
  self.options.merge!(options)
end</pre>
    </td>
  </tr>
</table>
</div>
  
</div>


  <div id="instance_method_details" class="method_details_list">
    <h2>Instance Method Details</h2>
    
    
      <div class="method_details first">
  <p class="signature first" id="engine_options-instance_method">
  
    - (<tt>{Symbol =&gt; Object}</tt>) <strong>engine_options</strong>(additional_options = {}) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Non-destructively modifies <tt><a href="Configuration.html#options-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin/Configuration.html#options-instance_method" title="Sass::Plugin::Configuration#options (method)">#options</a></tt> so that default values are properly set, and returns the result.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>{Symbol =&gt; Object}</tt>)</span>
      
      
        <span class='name'>additional_options</span>
      
      
        <em class="default">(defaults to: <tt>{}</tt>)</em>
      
      
        &mdash;
        An options hash with which to merge <tt><a href="Configuration.html#options-instance_method" tppabs="http://sass-lang.com/docs/yardoc/Sass/Plugin/Configuration.html#options-instance_method" title="Sass::Plugin::Configuration#options (method)">#options</a></tt>
      
    </li>
  
</ul>
<h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>{Symbol =&gt; Object}</tt>)</span>
      
      
      
      
        &mdash;
        The modified options hash
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


318
319
320
321
322</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/compiler.rb', line 318</span>

def engine_options(additional_options = {})
  opts = options.merge(additional_options)
  opts[:load_paths] = load_paths(opts)
  opts
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="on_compilation_error-instance_method">
  
    - <strong>on_compilation_error</strong> {|error, template, css| ... }
  

  
</p><div class="docstring">
  <div class="discussion">
    <p class="note returns_void">This method returns an undefined value.</p><p>Register a callback to be run when there&#8217;s an error compiling a Sass file. This could include not only errors in the Sass document, but also errors accessing the file at all.</p>

  </div>
</div>
<div class="tags">
  <h3>Yields:</h3>
<ul class="yield">
  
    <li>
      
        <span class='type'>(<tt>error</tt>, <tt>template</tt>, <tt>css</tt>)</span>
      
      
      
      
        &mdash;
        When the callback is run
      
    </li>
  
</ul>
<h3>Yield Parameters:</h3>
<ul class="yieldparam">
  
    <li>
      
        <span class='type'>(<tt>Exception</tt>)</span>
      
      
        <span class='name'>error</span>
      
      
      
        &mdash;
        The exception that was raised.
      
    </li>
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>template</span>
      
      
      
        &mdash;
        The location of the Sass/SCSS file being updated.
      
    </li>
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>css</span>
      
      
      
        &mdash;
        The location of the CSS file being generated.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


120</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/compiler.rb', line 120</span>

define_callback :compilation_error</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="on_creating_directory-instance_method">
  
    - <strong>on_creating_directory</strong> {|dirname| ... }
  

  
</p><div class="docstring">
  <div class="discussion">
    <p class="note returns_void">This method returns an undefined value.</p><p>Register a callback to be run when Sass creates a directory into which to put CSS files.</p>

<p>Note that even if multiple levels of directories need to be created, the callback may only be run once. For example, if &#8220;foo/&#8221; exists and &#8220;foo/bar/baz/&#8221; needs to be created, this may only be run for &#8220;foo/bar/baz/&#8221;. This is not a guarantee, however; it may also be run for &#8220;foo/bar/&#8221;.</p>

  </div>
</div>
<div class="tags">
  <h3>Yields:</h3>
<ul class="yield">
  
    <li>
      
        <span class='type'>(<tt>dirname</tt>)</span>
      
      
      
      
        &mdash;
        When the callback is run
      
    </li>
  
</ul>
<h3>Yield Parameters:</h3>
<ul class="yieldparam">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>dirname</span>
      
      
      
        &mdash;
        The location of the directory that was created.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


135</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/compiler.rb', line 135</span>

define_callback :creating_directory</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="on_deleting_css-instance_method">
  
    - <strong>on_deleting_css</strong> {|filename| ... }
  

  
</p><div class="docstring">
  <div class="discussion">
    <p class="note returns_void">This method returns an undefined value.</p><p>Register a callback to be run when Sass deletes a CSS file. This happens when the corresponding Sass/SCSS file has been deleted.</p>

  </div>
</div>
<div class="tags">
  <h3>Yields:</h3>
<ul class="yield">
  
    <li>
      
        <span class='type'>(<tt>filename</tt>)</span>
      
      
      
      
        &mdash;
        When the callback is run
      
    </li>
  
</ul>
<h3>Yield Parameters:</h3>
<ul class="yieldparam">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>filename</span>
      
      
      
        &mdash;
        The location of the CSS file that was deleted.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


170</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/compiler.rb', line 170</span>

define_callback :deleting_css</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="on_not_updating_stylesheet-instance_method">
  
    - <strong>on_not_updating_stylesheet</strong> {|template, css| ... }
  

  
</p><div class="docstring">
  <div class="discussion">
    <p class="note returns_void">This method returns an undefined value.</p><p>Register a callback to be run when Sass decides not to update a stylesheet. In particular, the callback is run when Sass finds that the template file and none of its dependencies have been modified since the last compilation.</p>

<p>Note that this is <strong>not</strong> run when the <a href="file.SASS_REFERENCE.html#never-update_option" tppabs="http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#never-update_option" title="&lt;code&gt;:never_update&lt;/code&gt; option"><code>:never_update</code> option</a> is set, nor when Sass decides not to compile a partial.</p>

  </div>
</div>
<div class="tags">
  <h3>Yields:</h3>
<ul class="yield">
  
    <li>
      
        <span class='type'>(<tt>template</tt>, <tt>css</tt>)</span>
      
      
      
      
        &mdash;
        When the callback is run
      
    </li>
  
</ul>
<h3>Yield Parameters:</h3>
<ul class="yieldparam">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>template</span>
      
      
      
        &mdash;
        The location of the Sass/SCSS file not being updated.
      
    </li>
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>css</span>
      
      
      
        &mdash;
        The location of the CSS file not being generated.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


107</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/compiler.rb', line 107</span>

define_callback :not_updating_stylesheet</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="on_template_created-instance_method">
  
    - <strong>on_template_created</strong> {|template| ... }
  

  
</p><div class="docstring">
  <div class="discussion">
    <p class="note returns_void">This method returns an undefined value.</p><p>Register a callback to be run when Sass detects that a new template has been created. This is only run when using <tt><a href="#watch-instance_method" title="Sass::Plugin::Compiler#watch (method)">#watch</a></tt>.</p>

  </div>
</div>
<div class="tags">
  <h3>Yields:</h3>
<ul class="yield">
  
    <li>
      
        <span class='type'>(<tt>template</tt>)</span>
      
      
      
      
        &mdash;
        When the callback is run
      
    </li>
  
</ul>
<h3>Yield Parameters:</h3>
<ul class="yieldparam">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>template</span>
      
      
      
        &mdash;
        The location of the template that was created.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


153</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/compiler.rb', line 153</span>

define_callback :template_created</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="on_template_deleted-instance_method">
  
    - <strong>on_template_deleted</strong> {|template| ... }
  

  
</p><div class="docstring">
  <div class="discussion">
    <p class="note returns_void">This method returns an undefined value.</p><p>Register a callback to be run when Sass detects that a template has been deleted. This is only run when using <tt><a href="#watch-instance_method" title="Sass::Plugin::Compiler#watch (method)">#watch</a></tt>.</p>

  </div>
</div>
<div class="tags">
  <h3>Yields:</h3>
<ul class="yield">
  
    <li>
      
        <span class='type'>(<tt>template</tt>)</span>
      
      
      
      
        &mdash;
        When the callback is run
      
    </li>
  
</ul>
<h3>Yield Parameters:</h3>
<ul class="yieldparam">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>template</span>
      
      
      
        &mdash;
        The location of the template that was deleted.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


162</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/compiler.rb', line 162</span>

define_callback :template_deleted</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="on_template_modified-instance_method">
  
    - <strong>on_template_modified</strong> {|template| ... }
  

  
</p><div class="docstring">
  <div class="discussion">
    <p class="note returns_void">This method returns an undefined value.</p><p>Register a callback to be run when Sass detects that a template has been modified. This is only run when using <tt><a href="#watch-instance_method" title="Sass::Plugin::Compiler#watch (method)">#watch</a></tt>.</p>

  </div>
</div>
<div class="tags">
  <h3>Yields:</h3>
<ul class="yield">
  
    <li>
      
        <span class='type'>(<tt>template</tt>)</span>
      
      
      
      
        &mdash;
        When the callback is run
      
    </li>
  
</ul>
<h3>Yield Parameters:</h3>
<ul class="yieldparam">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>template</span>
      
      
      
        &mdash;
        The location of the template that was modified.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


144</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/compiler.rb', line 144</span>

define_callback :template_modified</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="on_updated_stylesheet-instance_method">
  
    - <strong>on_updated_stylesheet</strong> {|template, css| ... }
  

  
</p><div class="docstring">
  <div class="discussion">
    <p class="note returns_void">This method returns an undefined value.</p><p>Register a callback to be run after a single stylesheet is updated. The callback is only run if the stylesheet is really updated; if the CSS file is fresh, this won&#8217;t be run.</p>

<p>Even if the <a href="file.SASS_REFERENCE.html#full_exception-option" tppabs="http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#full_exception-option" title="&lt;code&gt;:full_exception&lt;/code&gt; option"><code>:full_exception</code> option</a> is enabled, this callback won&#8217;t be run when an exception CSS file is being written. To run an action for those files, use <tt><a href="#on_compilation_error-instance_method" title="Sass::Plugin::Compiler#on_compilation_error (method)">#on_compilation_error</a></tt>.</p>

  </div>
</div>
<div class="tags">
  <h3>Yields:</h3>
<ul class="yield">
  
    <li>
      
        <span class='type'>(<tt>template</tt>, <tt>css</tt>)</span>
      
      
      
      
        &mdash;
        When the callback is run
      
    </li>
  
</ul>
<h3>Yield Parameters:</h3>
<ul class="yieldparam">
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>template</span>
      
      
      
        &mdash;
        The location of the Sass/SCSS file being updated.
      
    </li>
  
    <li>
      
        <span class='type'>(<tt>String</tt>)</span>
      
      
        <span class='name'>css</span>
      
      
      
        &mdash;
        The location of the CSS file being generated.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


68</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/compiler.rb', line 68</span>

define_callback :updated_stylesheet</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="on_updating_stylesheet_with_deprecation_warning-instance_method">
  
    - <strong>on_updating_stylesheet_with_deprecation_warning</strong>(&amp;block) 
  

  
    <span class="aliases">Also known as:
    <span class="names"><span id='on_updating_stylesheet-instance_method'>on_updating_stylesheet</span></span>
    </span>
  
</p><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


86
87
88
89</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/compiler.rb', line 86</span>

def on_updating_stylesheet_with_deprecation_warning(&block)
  Sass::Util.sass_warn("Sass::Compiler#on_updating_stylesheet callback is deprecated and will be removed in a future release. Use Sass::Compiler#on_updated_stylesheet instead, which is run after stylesheet compilation.")
  on_updating_stylesheet_without_deprecation_warning(&block)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="on_updating_stylesheets-instance_method">
  
    - <strong>on_updating_stylesheets</strong> {|individual_files| ... }
  

  
</p><div class="docstring">
  <div class="discussion">
    <p class="note returns_void">This method returns an undefined value.</p><p>Register a callback to be run after stylesheets are mass-updated. This is run whenever <tt><a href="#update_stylesheets-instance_method" title="Sass::Plugin::Compiler#update_stylesheets (method)">#update_stylesheets</a></tt> is called, unless the <a href="file.SASS_REFERENCE.html#never_update-option" tppabs="http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#never_update-option" title="&lt;code&gt;:never_update&lt;/code&gt; option"><code>:never_update</code> option</a> is enabled.</p>

  </div>
</div>
<div class="tags">
  <h3>Yields:</h3>
<ul class="yield">
  
    <li>
      
        <span class='type'>(<tt>individual_files</tt>)</span>
      
      
      
      
        &mdash;
        When the callback is run
      
    </li>
  
</ul>
<h3>Yield Parameters:</h3>
<ul class="yieldparam">
  
    <li>
      
        <span class='type'>(<tt>&lt;(String, String)&gt;</tt>)</span>
      
      
        <span class='name'>individual_files</span>
      
      
      
        &mdash;
        Individual files to be updated, in addition to the directories specified in the options. The first element of each pair is the source file, the second is the target CSS file.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


52</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/compiler.rb', line 52</span>

define_callback :updating_stylesheets</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="stylesheet_needs_update?-instance_method">
  
    - (<tt>Boolean</tt>) <strong>stylesheet_needs_update?</strong>(css_file, template_file) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Compass expects this to exist</p>

  </div>
</div>
<div class="tags">
  <h3>Returns:</h3>
<ul class="return">
  
    <li>
      
        <span class='type'>(<tt>Boolean</tt>)</span>
      
      
      
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


325
326
327</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/compiler.rb', line 325</span>

def stylesheet_needs_update?(css_file, template_file)
  StalenessChecker.stylesheet_needs_update?(css_file, template_file)
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="update_stylesheets-instance_method">
  
    - <strong>update_stylesheets</strong>(individual_files = []) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Updates out-of-date stylesheets.</p>

<p>Checks each Sass/SCSS file in <a href="file.SASS_REFERENCE.html#template_location-option" tppabs="http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#template_location-option" title="&lt;code&gt;:template_location&lt;/code&gt;"><code>:template_location</code></a> to see if it&#8217;s been modified more recently than the corresponding CSS file in <a href="file.SASS_REFERENCE.html#css_location-option" tppabs="http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#css_location-option" title="&lt;code&gt;:css_location&lt;/code&gt;"><code>:css_location</code></a>. If it has, it updates the CSS file.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;(String, String)&gt;</tt>)</span>
      
      
        <span class='name'>individual_files</span>
      
      
        <em class="default">(defaults to: <tt>[]</tt>)</em>
      
      
        &mdash;
        A list of files to check for updates <strong>in addition to those specified by the <a href="file.SASS_REFERENCE.html#template_location-option" tppabs="http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#template_location-option" title="&lt;code&gt;:template_location&lt;/code&gt; option"><code>:template_location</code> option</a>.</strong> The first string in each pair is the location of the Sass/SCSS file, the second is the location of the CSS file that it should be compiled to.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/compiler.rb', line 185</span>

def update_stylesheets(individual_files = [])
  individual_files = individual_files.dup
  Sass::Plugin.checked_for_updates = true
  staleness_checker = StalenessChecker.new(engine_options)

  template_location_array.each do |template_location, css_location|
    Sass::Util.glob(File.join(template_location, "**", "[^_]*.s[ca]ss")).sort.each do |file|
      # Get the relative path to the file
      name = file.sub(template_location.to_s.sub(/\/*$/, '/'), "")
      css = css_filename(name, css_location)
      individual_files << [file, css]
    end
  end

  run_updating_stylesheets individual_files

  individual_files.each do |file, css|
    if options[:always_update] || staleness_checker.stylesheet_needs_update?(css, file)
      update_stylesheet(file, css)
    else
      run_not_updating_stylesheet(file, css)
    end
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
      <div class="method_details ">
  <p class="signature " id="watch-instance_method">
  
    - <strong>watch</strong>(individual_files = []) 
  

  
</p><div class="docstring">
  <div class="discussion">
    <p>Watches the template directory (or directories) and updates the CSS files whenever the related Sass/SCSS files change. <code>watch</code> never returns.</p>

<p>Whenever a change is detected to a Sass/SCSS file in <a href="file.SASS_REFERENCE.html#template_location-option" tppabs="http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#template_location-option" title="&lt;code&gt;:template_location&lt;/code&gt;"><code>:template_location</code></a>, the corresponding CSS file in <a href="file.SASS_REFERENCE.html#css_location-option" tppabs="http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#css_location-option" title="&lt;code&gt;:css_location&lt;/code&gt;"><code>:css_location</code></a> will be recompiled. The CSS files of any Sass/SCSS files that import the changed file will also be recompiled.</p>

<p>Before the watching starts in earnest, <code>watch</code> calls <tt><a href="#update_stylesheets-instance_method" title="Sass::Plugin::Compiler#update_stylesheets (method)">#update_stylesheets</a></tt>.</p>

<p>Note that <code>watch</code> uses the <a href="javascript:if(confirm(%27http://github.com/guard/listen  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://github.com/guard/listen%27" tppabs="http://github.com/guard/listen">Listen</a> library to monitor the filesystem for changes. Listen isn&#8217;t loaded until <code>watch</code> is run. The version of Listen distributed with Sass is loaded by default, but if another version has already been loaded that will be used instead.</p>

  </div>
</div>
<div class="tags">
  <h3>Parameters:</h3>
<ul class="param">
  
    <li>
      
        <span class='type'>(<tt>Array&lt;(String, String)&gt;</tt>)</span>
      
      
        <span class='name'>individual_files</span>
      
      
        <em class="default">(defaults to: <tt>[]</tt>)</em>
      
      
        &mdash;
        A list of files to watch for updates <strong>in addition to those specified by the <a href="file.SASS_REFERENCE.html#template_location-option" tppabs="http://sass-lang.com/docs/yardoc/file.SASS_REFERENCE.html#template_location-option" title="&lt;code&gt;:template_location&lt;/code&gt; option"><code>:template_location</code> option</a>.</strong> The first string in each pair is the location of the Sass/SCSS file, the second is the location of the CSS file that it should be compiled to.
      
    </li>
  
</ul>

</div><table class="source_code">
  <tr>
    <td>
      <pre class="lines">


234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311</pre>
    </td>
    <td>
      <pre class="code"><span class="info file"># File '/var/www/sass-pages/.sass/lib/sass/plugin/compiler.rb', line 234</span>

def watch(individual_files = [])
  update_stylesheets(individual_files)

  begin
    require 'listen'
  rescue LoadError => e
    dir = Sass::Util.scope("vendor/listen/lib")
    if $LOAD_PATH.include?(dir)
      e.message << "\n" <<
        if File.exists?(scope(".git"))
          'Run "git submodule update --init" to get the recommended version.'
        else
          'Run "gem install listen" to get it.'
        end
      raise e
    else
      $LOAD_PATH.unshift dir
      retry
    end
  end

  template_paths = template_locations # cache the locations
  individual_files_hash = individual_files.inject({}) do |h, files|
    parent = File.dirname(files.first)
    (h[parent] ||= []) << files unless template_paths.include?(parent)
    h
  end
  directories = template_paths + individual_files_hash.keys +
    [{:relative_paths => true}]

  # TODO: Keep better track of what depends on what
  # so we don't have to run a global update every time anything changes.
  listener = Listen::MultiListener.new(*directories) do |modified, added, removed|
    modified.each do |f|
      parent = File.dirname(f)
      if files = individual_files_hash[parent]
        next unless files.first == f
      else
        next unless f =~ /\.s[ac]ss$/
      end
      run_template_modified(f)
    end

    added.each do |f|
      parent = File.dirname(f)
      if files = individual_files_hash[parent]
        next unless files.first == f
      else
        next unless f =~ /\.s[ac]ss$/
      end
      run_template_created(f)
    end

    removed.each do |f|
      parent = File.dirname(f)
      if files = individual_files_hash[parent]
        next unless files.first == f
        try_delete_css files[1]
      else
        next unless f =~ /\.s[ac]ss$/
        try_delete_css f.gsub(/\.s[ac]ss$/, '.css')
      end
      run_template_deleted(f)
    end

    update_stylesheets(individual_files)
  end

  # The native windows listener is much slower than the polling
  # option, according to https://github.com/nex3/sass/commit/a3031856b22bc834a5417dedecb038b7be9b9e3e#commitcomment-1295118
  listener.force_polling(true) if @options[:poll] || Sass::Util.windows?

  begin
    listener.start
  rescue Exception => e
    raise e unless e.is_a?(Interrupt)
  end
end</pre>
    </td>
  </tr>
</table>
</div>
    
  </div>

</div>
    
    <div id="footer">
  Generated on Fri Mar  8 20:33:32 2013 by 
  <a href="javascript:if(confirm(%27http://yardoc.org/  \n\nThis file was not retrieved by Teleport Pro, because it is addressed on a domain or path outside the boundaries set for its Starting Address.  \n\nDo you want to open it from the server?%27))window.location=%27http://yardoc.org/%27" tppabs="http://yardoc.org/" title="Yay! A Ruby Documentation Tool">yard</a>
  0.5.3 (ruby-1.8.7).
</div>


  <script type="text/javascript">
  var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
  document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
  </script>
  <script type="text/javascript">
  try {
  var pageTracker = _gat._getTracker("UA-535380-8");
  pageTracker._trackPageview();
  } catch(err) {}</script>


  </body>
</html>